import { defineStore } from 'pinia'
import { getAPIList } from '../server/index'
import type { RootObject,Children,ChinaTotal,ChinaAdd } from './type'
export const useListStore = defineStore({
  id: 'List',
  state: () => ({
    list: <RootObject>{},//借口返回的根内容
    item: <Children[]>[],//每个省的市级内容
    ChinaTotal: <ChinaTotal>{},
    ChinaAdd: <ChinaAdd>{}
  }),
  actions: {
   async getList() {
      const res = await getAPIList()
      console.log('getAPIList.res', res)
      this.list = res
      // console.log('this.list',this.list)
    }
  
  }
})